package com.kx.kxpicture.model.enums;

import cn.hutool.core.util.ObjUtil;
import lombok.Getter;

/**
 * 类功能描述
 *
 * @author kuangxin
 * date 2025/9/13
 */
@Getter
public enum SpaceTypeEnum {
    PRIVATE("私有空间",0),
    TEAM("团队空间",1);

    private final String text;
    private final int value;

    SpaceTypeEnum(String text,Integer value){
        this.text=text;
        this.value=value;
    }

    /**
     * 根据value获取值
     */
    public static SpaceTypeEnum getEnumByValue(Integer value){
        if (ObjUtil.isEmpty(value)){
            return null;
        }
        for (SpaceTypeEnum spaceTypeEnum:SpaceTypeEnum.values()){
            if(spaceTypeEnum.value==value){
                return spaceTypeEnum;
            }
        }
        return null;
    }
}

